﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.ModelBinding;
using System.Web.UI;
using System.Web.UI.WebControls;
using Box.BL;
using Microsoft.Practices.Unity;
using Box.Entities;


namespace Box.Cliente.Administracion.Bancos
{
    public partial class frmListBanco : System.Web.UI.Page
    {
        [Dependency]
        public IBancoBL bancoBL { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var acc = Request.QueryString["acc"];
                var id = Request.QueryString["id"];

                if (acc != null && id != null && acc == "eliminar")
                {
                    var identificado = Int32.Parse(id.ToString());
                    bancoBL.RemoveBanco(identificado);
                }
            }
        }

        public IEnumerable<Entities.Banco> GetBancos([Control("txtCriterio")]string criterio)
        {
            return bancoBL.GetFromBancosByCriterio(criterio);
        }

    }
}